using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for CardItem
/// </summary>
public class CartItem
{
    int itemID;
    string itemName;
    decimal price;
    int quatity;


	public CartItem()
	{
        this.itemID = -1;
        this.itemName = "";
        this.price = 0;
        this.quatity = 0;
	}
    public CartItem(int _id, string _name, decimal _price, int _quantity)
    {
        
        this.itemID = _id;
        this.itemName = _name;
        this.price = _price;
        this.quatity = _quantity;  
    }
    #region properties
    public int ItemID
    {
        get { return itemID; }
        set { itemID = value; }
    }
    public string ItemName
    {
        get { return itemName; }
        set { itemName = value; }
    }
    public decimal Price
    {
        get { return price; }
        set { price = value; }
    }
    public int Quantity
    {
        get { return quatity; }
        set { quatity = value; }
    }
    public decimal Amount
    {
        get { return quatity*price; }
       
    }
    #endregion
    #region methods
    public override bool Equals(object obj)
    {
        CartItem item = obj as CartItem;
        return this.ItemID==item.ItemID;
    }
    #endregion
}
